module.exports = {
  transpileDependencies: ["webpack-dev-server/client"],
  chainWebpack: (config) => {
    config.entry.app = ["babel-polyfill", "./src/main.ts"];
    if (process.env.NODE_ENV === "production" && process.VUE_CLI_SERVICE.mode === "production") {
      if (config.has("externals")) {
        config.externals.set("xe-utils", "xe-utils").set("dayjs", "dayjs").set("lodash", "lodash");
      } else {
        config.set("externals", {
          "xe-utils": "xe-utils",
          dayjs: "dayjs",
          lodash: "lodash",
        });
      }
    }
  },
  publicPath: "./", //vcu-mobile
  outputDir: "dist",
  assetsDir: "static",
  lintOnSave: false,
  css: {
    extract: ["production", "development"].includes(process.env.NODE_ENV),
    loaderOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
};
